#ifndef __LOG_H__
#define __LOG_H__
#include "app_driver.h"
#if DEBUG_ENABLE_UART > 0
extern void log(char*fmt,...);
extern void log_bytes(U8*d,int len);

//#define log_info(...)  do{log("\n %-6lld %-20s[%4d] :", timems(0), __FUNCTION__,__LINE__);log(## __VA_ARGS__);}while(0);
#define log_raw(enable,...)        if((enable)){log(## __VA_ARGS__);}
#define log_info(enable,...)       if((enable)){do{     log("\n ");log(## __VA_ARGS__);   }while(0);}
//#define log_info(...)  do{log("\n %-6lld", timems(0));log(## __VA_ARGS__);}while(0);
#define log_info_bytes(enable,...) if(enable){log_bytes(## __VA_ARGS__);}
#else
#define log_raw(...)
#define log_info(...)
#define log_info_bytes(...)
#endif



#ifndef  NOT_USING_LOG
#define info(...)        log_info(IF_LOGBIT(LOG_BIT_ENABLE),__VA_ARGS__)
#define info_bytes(...)  log_info_bytes(IF_LOGBIT(LOG_BIT_ENABLE),__VA_ARGS__)
#define info_raw(...)    log_raw(IF_LOGBIT(LOG_BIT_ENABLE),__VA_ARGS__)
#else
#define info(...)
#define info_bytes(...)
#endif


#endif
